//
// Created by Martin on 2021/9/30.
//

#include "IShop.h"
#include "ClothesShop.h"
#include "ShoesShop.h"
#include "SmallYShopProxy.h"

/**
 * 代理模式应用示例
 * 应用场景: 实体店, 代理商店销售商品
 * @see https://www.jianshu.com/p/b393a02e6a95
 */
int main()
{
    // 定义一个鞋子实体店
    IShop *shoesShop = new ShoesShop();
    // 定义小Y杂货店代售鞋子
    auto *proxy = new SmallYShopProxy(shoesShop);
    proxy->sale("板鞋");

    delete proxy;
    delete shoesShop;
    return 0;
}